﻿<!DOCTYPE html>
<html>

<head>
  <title>正式-模拟考试 题库</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet" />
  <link href="data/styles.css" type="text/css" rel="stylesheet" />
  <link href="files/正式-模拟考试_题库/styles.css" type="text/css" rel="stylesheet" />
  <script src="resources/scripts/jquery-3.2.1.min.js"></script>
  <script src="resources/scripts/axure/axQuery.js"></script>
  <script src="resources/scripts/axure/globals.js"></script>
  <script src="resources/scripts/axutils.js"></script>
  <script src="resources/scripts/axure/annotation.js"></script>
  <script src="resources/scripts/axure/axQuery.std.js"></script>
  <script src="resources/scripts/axure/doc.js"></script>
  <script src="resources/scripts/messagecenter.js"></script>
  <script src="resources/scripts/axure/events.js"></script>
  <script src="resources/scripts/axure/recording.js"></script>
  <script src="resources/scripts/axure/action.js"></script>
  <script src="resources/scripts/axure/expr.js"></script>
  <script src="resources/scripts/axure/geometry.js"></script>
  <script src="resources/scripts/axure/flyout.js"></script>
  <script src="resources/scripts/axure/model.js"></script>
  <script src="resources/scripts/axure/repeater.js"></script>
  <script src="resources/scripts/axure/sto.js"></script>
  <script src="resources/scripts/axure/utils.temp.js"></script>
  <script src="resources/scripts/axure/variables.js"></script>
  <script src="resources/scripts/axure/drag.js"></script>
  <script src="resources/scripts/axure/move.js"></script>
  <script src="resources/scripts/axure/visibility.js"></script>
  <script src="resources/scripts/axure/style.js"></script>
  <script src="resources/scripts/axure/adaptive.js"></script>
  <script src="resources/scripts/axure/tree.js"></script>
  <script src="resources/scripts/axure/init.temp.js"></script>
  <script src="resources/scripts/axure/legacy.js"></script>
  <script src="resources/scripts/axure/viewer.js"></script>
  <script src="resources/scripts/axure/math.js"></script>
  <script src="resources/scripts/axure/jquery.nicescroll.min.js"></script>
  <script src="data/document.js"></script>
  <script src="files/正式-模拟考试_题库/data.js"></script>
  <script type="text/javascript">
    $axure.utils.getTransparentGifPath = function () { return 'resources/images/transparent.gif'; };
    $axure.utils.getOtherPath = function () { return 'resources/Other.html'; };
    $axure.utils.getReloadPath = function () { return 'resources/reload.html'; };
  </script>
</head>

<body>
  <div id="base" class="">

    <!-- Unnamed (Dynamic Panel) -->
    <div id="u393" class="ax_default">
      <div id="u393_state0" class="panel_state" data-label="State1" style="">
        <div id="u393_state0_content" class="panel_state_content">

          <!-- Unnamed (Group) -->
          <div id="u394" class="ax_default u394" data-left="65" data-top="170" data-width="355" data-height="230">

            <!-- Unnamed (Rectangle) -->
            <div id="u395" class="ax_default box_2">
              <div id="u395_div" class=""></div>
              <div id="u395_text" class="text " style="display:none; visibility: hidden">
                <p></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u396" class="ax_default _标题3">
              <div id="u396_div" class=""></div>
              <div id="u396_text" class="text ">
                <p><span>考试类型：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u397" class="ax_default box_2">
              <div id="u397_div" class=""></div>
              <div id="u397_text" class="text u397_text">
                <p><span style="font-family:'Helvetica', sans-serif;">2021</span><span
                    style="font-family:'PingFangSC-Regular', 'PingFang SC', sans-serif;">年第二季度前端模拟考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u398" class="ax_default _标题3">
              <div id="u398_div" class=""></div>
              <div id="u398_text" class="text ">
                <p><span>考试地址：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u399" class="ax_default _文本">
              <div id="u399_div" class=""></div>
              <div id="u399_text" class="text ">
                <p><span>正式考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u400" class="ax_default _文本">
              <div id="u400_div" class=""></div>
              <div id="u400_text" class="text ">
                <p><span>信息中心会议室</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u401" class="ax_default box_2">
              <div id="u401_div" class="u401_div"></div>
              <div id="u401_text" class="text u401_text">
                <p><span>参加考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u402" class="ax_default _标题3">
              <div id="u402_div" class=""></div>
              <div id="u402_text" class="text ">
                <p><span>已考人数：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u403" class="ax_default _文本">
              <div id="u403_div" class=""></div>
              <div id="u403_text" class="text ">
                <p><span>343人</span></p>
              </div>
            </div>
          </div>

          <!-- Unnamed (top nav) -->

          <!-- Unnamed (Rectangle) -->
          <div id="u405" class="ax_default box_2">
            <div id="u405_div" class=""></div>
            <div id="u405_text" class="text " style="display:none; visibility: hidden">
              <p></p>
            </div>
          </div>

          <!-- Unnamed (Rectangle) -->
          <div id="u406" class="ax_default _文本">
            <div id="u406_div" class=""></div>
            <div id="u406_text" class="text ">
              <p><span class="userName">蜗牛测试账号</span></p>
            </div>
          </div>

          <!-- Unnamed (Rectangle) -->
          <div id="u407" class="ax_default box_2">
            <div id="u407_div" class="userPhotoUrl"></div>
            <div id="u407_text" class="text " style="display:none; visibility: hidden">
              <p></p>
            </div>
          </div>

          <!-- Unnamed (Image) -->
          <div id="u408" class="ax_default _图片">
            <img id="u408_img" class="img " src="images/登录/u15.png" />
            <div id="u408_text" class="text " style="display:none; visibility: hidden">
              <p></p>
            </div>
          </div>

          <!-- Unnamed (Rectangle) -->
          <div id="u409" class="ax_default _文本">
            <div id="u409_div" class=""></div>
            <div id="u409_text" class="text ">
              <p><span>蜗牛考试系统</span></p>
            </div>
          </div>
          <div id="u404" style="display:none; visibility:hidden;"></div>

          <!-- Unnamed (Group) -->
          <div id="u410" class="ax_default u410" data-left="445" data-top="170" data-width="355" data-height="230">

            <!-- Unnamed (Rectangle) -->
            <div id="u411" class="ax_default box_2">
              <div id="u411_div" class=""></div>
              <div id="u411_text" class="text " style="display:none; visibility: hidden">
                <p></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u412" class="ax_default _标题3">
              <div id="u412_div" class=""></div>
              <div id="u412_text" class="text ">
                <p><span>考试类型：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u413" class="ax_default box_2">
              <div id="u413_div" class=""></div>
              <div id="u413_text" class="text u413_text">
                <p><span style="font-family:'Helvetica', sans-serif;">2021</span><span
                    style="font-family:'PingFangSC-Regular', 'PingFang SC', sans-serif;">年第二季度JavaScript模拟考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u414" class="ax_default _标题3">
              <div id="u414_div" class=""></div>
              <div id="u414_text" class="text ">
                <p><span>考试地址：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u415" class="ax_default _文本">
              <div id="u415_div" class=""></div>
              <div id="u415_text" class="text ">
                <p><span>正式考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u416" class="ax_default _文本">
              <div id="u416_div" class=""></div>
              <div id="u416_text" class="text ">
                <p><span>信息中心会议室</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u417" class="ax_default box_2">
              <div id="u417_div" class="u417_div"></div>
              <div id="u417_text" class="text u417_text">
                <p><span>已考试，看解析</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u418" class="ax_default _标题3">
              <div id="u418_div" class=""></div>
              <div id="u418_text" class="text ">
                <p><span>已考人数：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u419" class="ax_default _文本">
              <div id="u419_div" class=""></div>
              <div id="u419_text" class="text ">
                <p><span>343人</span></p>
              </div>
            </div>
          </div>

          <!-- Unnamed (Group) -->
          <div id="u420" class="ax_default u420" data-left="825" data-top="170" data-width="355" data-height="230">

            <!-- Unnamed (Rectangle) -->
            <div id="u421" class="ax_default box_2">
              <div id="u421_div" class=""></div>
              <div id="u421_text" class="text " style="display:none; visibility: hidden">
                <p></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u422" class="ax_default _标题3">
              <div id="u422_div" class=""></div>
              <div id="u422_text" class="text ">
                <p><span>考试类型：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u423" class="ax_default box_2">
              <div id="u423_div" class=""></div>
              <div id="u423_text" class="text u423_text">
                <p><span style="font-family:'Helvetica', sans-serif;">2021</span><span
                    style="font-family:'PingFangSC-Regular', 'PingFang SC', sans-serif;">年第三季Vue.js知识模拟考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u424" class="ax_default _标题3">
              <div id="u424_div" class=""></div>
              <div id="u424_text" class="text ">
                <p><span>考试地址：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u425" class="ax_default _文本">
              <div id="u425_div" class=""></div>
              <div id="u425_text" class="text ">
                <p><span>正式考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u426" class="ax_default _文本">
              <div id="u426_div" class=""></div>
              <div id="u426_text" class="text ">
                <p><span>信息中心会议室</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u427" class="ax_default box_2">
              <div id="u427_div" class="u427_div"></div>
              <div id="u427_text" class="text u427_text">
                <p><span>参加考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u428" class="ax_default _标题3">
              <div id="u428_div" class=""></div>
              <div id="u428_text" class="text ">
                <p><span>已考人数：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u429" class="ax_default _文本">
              <div id="u429_div" class=""></div>
              <div id="u429_text" class="text ">
                <p><span>343人</span></p>
              </div>
            </div>
          </div>

          <!-- Unnamed (Group) -->
          <div id="u430" class="ax_default" data-left="65" data-top="85" data-width="1115" data-height="65">

            <!-- Unnamed (Rectangle) -->
            <div id="u431" class="ax_default box_2">
              <div id="u431_div" class=""></div>
              <div id="u431_text" class="text ">
                <p><span>正式考试题库</span></p>
              </div>
            </div>

            <!-- Unnamed (Group) -->
            <div id="u432" class="ax_default" data-left="65" data-top="90" data-width="185" data-height="55">

              <!-- Unnamed (Rectangle) -->
              <div id="u433" class="ax_default _文本">
                <div id="u433_div" class=""></div>
                <div id="u433_text" class="text ">
                  <p><span>返回主页</span></p>
                </div>
              </div>

              <!-- Unnamed (SVG) -->
              <div id="u434" class="ax_default _图片">
                <img id="u434_img" class="img " src="images/正式-模拟考试_题库/u434.svg" />
                <div id="u434_text" class="text " style="display:none; visibility: hidden">
                  <p></p>
                </div>
              </div>
            </div>
          </div>

          <!-- Unnamed (Group) -->
          <div id="u435" class="ax_default" data-left="1032" data-top="100" data-width="128" data-height="38">

            <!-- Unnamed (Rectangle) -->
            <div id="u436" class="ax_default _文本">
              <div id="u436_div" class=""></div>
              <div id="u436_text" class="text ">
                <p><span>全 部&nbsp; &nbsp;&nbsp; </span></p>
              </div>
            </div>

            <!-- Unnamed (SVG) -->
            <div id="u437" class="ax_default _图片">
              <img id="u437_img" class="img " src="images/主页/u98.svg" />
              <div id="u437_text" class="text " style="display:none; visibility: hidden">
                <p></p>
              </div>
            </div>
          </div>

          <!-- all-yidu-weidu (Group) -->
          <div id="u438" class="ax_default" data-label="all-yidu-weidu" data-left="1032" data-top="148" data-width="128"
            data-height="126">

            <!-- Unnamed (Rectangle) -->
            <div id="u439" class="ax_default box_2">
              <div id="u439_div" class=""></div>
              <div id="u439_text" class="text ">
                <p><span>&nbsp;</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u440" class="ax_default _文本">
              <div id="u440_div" class=""></div>
              <div id="u440_text" class="text ">
                <p><span>未 考</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u441" class="ax_default _文本">
              <div id="u441_div" class=""></div>
              <div id="u441_text" class="text ">
                <p><span>已 考</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u442" class="ax_default _文本">
              <div id="u442_div" class=""></div>
              <div id="u442_text" class="text ">
                <p><span>全 部</span></p>
              </div>
            </div>
          </div>

          <!-- Unnamed (Group) -->
          <div id="u443" class="ax_default u443" data-left="65" data-top="420" data-width="355" data-height="230">

            <!-- Unnamed (Rectangle) -->
            <div id="u444" class="ax_default box_2">
              <div id="u444_div" class=""></div>
              <div id="u444_text" class="text " style="display:none; visibility: hidden">
                <p></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u445" class="ax_default _标题3">
              <div id="u445_div" class=""></div>
              <div id="u445_text" class="text ">
                <p><span>考试类型：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u446" class="ax_default box_2">
              <div id="u446_div" class=""></div>
              <div id="u446_text" class="text u446_text">
                <p><span style="font-family:'Helvetica', sans-serif;">2021</span><span
                    style="font-family:'PingFangSC-Regular', 'PingFang SC', sans-serif;">年第三季React知识模拟考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u447" class="ax_default _标题3">
              <div id="u447_div" class=""></div>
              <div id="u447_text" class="text ">
                <p><span>考试地址：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u448" class="ax_default _文本">
              <div id="u448_div" class=""></div>
              <div id="u448_text" class="text ">
                <p><span>正式考试</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u449" class="ax_default _文本">
              <div id="u449_div" class=""></div>
              <div id="u449_text" class="text ">
                <p><span>信息中心会议室</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u450" class="ax_default box_2">
              <div id="u450_div" class="u450_div"></div>
              <div id="u450_text" class="text u450_text">
                <p><span>已考试，看解析</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u451" class="ax_default _标题3">
              <div id="u451_div" class=""></div>
              <div id="u451_text" class="text ">
                <p><span>已考人数：</span></p>
              </div>
            </div>

            <!-- Unnamed (Rectangle) -->
            <div id="u452" class="ax_default _文本">
              <div id="u452_div" class=""></div>
              <div id="u452_text" class="text ">
                <p><span>343人</span></p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <script src="resources/scripts/axure/ios.js"></script>
  <script>
    // 不能动态添加，默认全部隐藏
    $('.u394,.u410,.u420,.u443').css('display', 'none');
    // 按钮默认样式
    $('.u401_div,.u417_div,.u427_div,.u450_div').css("background", `rgba(0, 153, 0, 1)`);
    $('.u401_text,.u417_text,.u427_text,.u450_text').html('参加考试');


    // token
    var token = localStorage.getItem('token');
    // 获取当前用户id
    var userId = localStorage.getItem('userId');
    // 当前类型 ”正式考试“
    var nowTypeId = localStorage.getItem('nowTypeId');


    // 正式考试页。通过 userId 获取用户信息
    var userData = (function () {
      $.ajax({
        type: 'POST',
        url: 'http://localhost:3000/nowUser',
        data: {
          'userId': userId
        },
        headers: {
          Authorization: 'Bearer ' + token
        },
        async: false,
        success: function (res) {
          userData = res;
        },
      })
      return userData;
    })();
    // console.log('返回的用户数据；', userData);
    if (userData.name) { // 右上角用户名
      $(".userName").html(userData.name);
    } else {
      $(".userName").html('起个名吧');
    }
    var userPhotoUrl = localStorage.getItem('userPhotoUrl');
    if (userPhotoUrl) {
      $(".userPhotoUrl").css("background", `url(${userPhotoUrl})`);
    }
    else {
      $(".userPhotoUrl").css("background", `pink`);
    }
    // 正式考试页。通过上个页面存的 nowType 先获取所有 对应的考试题
    var nowTypeTests = (function () {
      $.ajax({
        type: 'POST',
        url: 'http://localhost:3000/nowType/test/list',
        data: {
          'nowTypeId': nowTypeId
        },
        headers: {
          Authorization: 'Bearer ' + token
        },
        async: false,
        success: function (res) {
          nowTypeTests = res;
        },
      })
      return nowTypeTests;
    })();
    // console.log('返回的考试具体信息 ；', nowTypeTests);
    // // 这是四个考试，var他们是，避免编号改变，页面乱套
    var nowTypeTests_html;
    var nowTypeTests_js;
    var nowTypeTests_vue;
    var nowTypeTests_react;
    nowTypeTests.forEach(item => {
      if (item._id == '610bce08a50c000097006451') {
        nowTypeTests_html = item;
      }
      if (item._id == '610bce08a50c000097006455') {
        nowTypeTests_js = item;
      }
      if (item._id == '610bce08a50c000097006459') {
        nowTypeTests_vue = item;
      }
      if (item._id == '610bce08a50c00009700644d') {
        nowTypeTests_react = item;
      }
    })
    console.log(nowTypeTests_html);
    console.log(nowTypeTests_js);
    console.log(nowTypeTests_vue);
    console.log(nowTypeTests_react);

    // 第一个 HTML
    if (nowTypeTests_html) {
      // 模拟动态显示
      $('.u394').css('display', 'block');
      // 更改标题
      $('.u397_text').html('');
      $('.u397_text').html(nowTypeTests_html.title);
      $('#u399_text p span').html('无此数据');
      $('#u400_text p span').html('无此数据');
      $('#u403_text p span').html('无此数据');
    }
    // 第二个 JS
    if (nowTypeTests_js) {
      $('.u410').css('display', 'block');
      $('.u413_text').html('');
      $('.u413_text').html(nowTypeTests_js.title);
      $('#u415_text p span').html('无此数据');
      $('#u416_text p span').html('无此数据');
      $('#u419_text p span').html('无此数据');
    }
    // 第三个 Vue
    if (nowTypeTests_vue) {
      $('.u420').css('display', 'block');
      $('.u423_text').html('');
      $('.u423_text').html(nowTypeTests_vue.title);
      $('#u425_text p span').html('无此数据');
      $('#u426_text p span').html('无此数据');
      $('#u429_text p span').html('无此数据');
    }
    // 第四个 Rect
    if (nowTypeTests_react) {
      $('.u443').css('display', 'block');
      $('.u446_text').html('');
      $('.u446_text').html(nowTypeTests_react.title);
      $('#u448_text p span').html('无此数据');
      $('#u449_text p span').html('无此数据');
      $('#u452_text p span').html('无此数据');
    }

    // 正式考试页。通过 userId 找出 tested 里面的 所有 testId
    var tested = (function () {
      $.ajax({
        type: 'POST',
        url: 'http://localhost:3000/tested/list',
        data: {
          'userId': userId
        },
        headers: {
          Authorization: 'Bearer ' + token
        },
        async: false,
        success: function (res) {
          tested = res;
        },
      })
      return tested;
    })();
    console.log('考过的信息；', tested);
    // 考过的按钮便样式
    tested.forEach(item => {
      if (item.testId == nowTypeTests_html._id) {
        $('.u401_div').css("background", `rgba(204, 204, 204, 1)`);
        $('.u401_text').html('已考试，看解析');
      } else if (item.testId == nowTypeTests_js._id) {
        $('.u417_div').css("background", `rgba(204, 204, 204, 1)`);
        $('.u417_text').html('已考试，看解析');
      } else if (item.testId == nowTypeTests_vue._id) {
        $('.u427_div').css("background", `rgba(204, 204, 204, 1)`);
        $('.u427_text').html('已考试，看解析');
      } else if (item.testId == nowTypeTests_react._id) {
        $('.u450_div').css("background", `rgba(204, 204, 204, 1)`);
        $('.u450_text').html('已考试，看解析');
      }
    });

    // 默认点击事件
    $("#u394").click(() => {
      localStorage.setItem('nowTestId', nowTypeTests_html._id);
      if ($('.u401_text').html() == '已考试，看解析') {
        location.href = "考试解析.html";
      } else {
        location.href = "开始考试.html";
      };
    })
    $("#u410").click(() => {
      localStorage.setItem('nowTestId', nowTypeTests_js._id);
      if ($('.u417_text').html() == '已考试，看解析') {
        location.href = "考试解析.html";
      } else {
        location.href = "开始考试.html";
      }
    })
    $("#u420").click(() => {
      localStorage.setItem('nowTestId', nowTypeTests_vue._id);
      if ($('.u427_text').html() == '已考试，看解析') {
        location.href = "考试解析.html";
      } else {
        location.href = "开始考试.html";
      }
    })
    $("#u443").click(() => {
      localStorage.setItem('nowTestId', nowTypeTests_react._id);
      if ($('.u450_text').html() == '已考试，看解析') {
        location.href = "考试解析.html";
      } else {
        location.href = "开始考试.html";
      }
    })
  </script>
</body>

</html>